/**
 * Copyright(c) kyle.
 */
package com.kyle.redpacket.dao.entity;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * 红包记录
 *
 * @author kyle
 * @version 1.00.00
 * @since: [2021-01-11 17:41]
 * @updateUser: [Kyle]
 * @updateRemark: [说明本次修改内容]
 * @date: [2021-01-11 17:41]
 */
@EqualsAndHashCode(callSuper = true)
@Data
@Entity
@Table(name = "RedRecord")
public class RedRecord extends BaseEntityAudit implements Serializable {
    private static final long serialVersionUID = 11456748213748L;
    /**
     * 抢到红包的用户
     */
    private Long userId;

    /**
     * 抢到的红包的ID
     */
    private String redPacketId;

    //抢到金额-单位为分
    @NotNull
    @Min(1)
    private Long amount;

    /**
     * 抢到的红包的顺序
     */
    @Column
    private Long orderNo;
}
